package org.dromara.common.core.domain.model

import jakarta.validation.constraints.NotBlank

/**
 *@author LikeYouDo
 *@date 2025/1/3 16:50
 */
data class SocialLoginBody(
    /**
     * 第三方登录平台
     */
    @NotBlank(message = "{social.source.not.blank}")
    var source: String = "",

    /**
     * 第三方登录code
     */
    @NotBlank(message = "{social.code.not.blank}")
    var socialCode: String = "",

    /**
     * 第三方登录socialState
     */
    @NotBlank(message = "{social.state.not.blank}")
    var socialState: String = "",
) : LoginBody() {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is SocialLoginBody) return false
        if (!super.equals(other)) return false

        if (source != other.source) return false
        if (socialCode != other.socialCode) return false
        if (socialState != other.socialState) return false

        return true
    }

    override fun hashCode(): Int {
        var result = super.hashCode()
        result = 31 * result + source.hashCode()
        result = 31 * result + socialCode.hashCode()
        result = 31 * result + socialState.hashCode()
        return result
    }
}
